﻿using CxRomos.Core.Domain.Entities;
using FluentNHibernate.Mapping;

namespace CxRomos.Core.Domain.Mappings {
    public class PersonMap : ClassMap<Person> {
        public PersonMap() {
            Table("[dbo].[Person]");
            OptimisticLock.Version();
            LazyLoad();

            Id(x => x.PersonId)
                .Column("PersonId")
                .GeneratedBy.Identity();

            Map(x => x.Email);
            Map(x => x.FirstName);
            Map(x => x.LastName);
        }
    }
}